

package com.kimo.shop.dao;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kimo.shop.bean.param.PayTopParam;
import com.kimo.shop.bean.param.ProdAnalysisSurveyParam;
import com.kimo.shop.bean.param.ProdEffectParam;
import com.kimo.shop.bean.param.ProdEffectRespParam;
import com.kimo.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import com.kimo.shop.bean.model.OrderItem;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

public interface OrderItemMapper extends BaseMapper<OrderItem> {

    List<OrderItem> listByOrderNumber(@Param("orderNumber") String orderNumber, @Param("lang") Integer dbLang);

//    List<OrderItem> getUnCloseRefundOrderItemByOrderNumberAndUserId(@Param("orderNumber") String orderNumber, @Param("userId") String userId);

    void updateByDeliveries(@Param("orderItems") List<OrderItem> orderItems);

    List<OrderItem> getListByOrderNumber(@Param("orderNumber") String orderNumber);
//	void insertBatch(List<OrderItem> orderItems);

    //	List<OrderItem> getPayByOrderNumber(@Param("orderNumber") String orderNumber);
    IPage<PayTopParam> getPayAmounts(PageParam<OrderItem> page, @Param("param") ProdAnalysisSurveyParam param, @Param("dbLang") Integer dbLang);

    PayTopParam getPayAmount(@Param("prodId") Long prodId, @Param("shopId") Long shopId);

    Integer countPayPerson(@Param("prodId") Long prodId, @Param("param") ProdEffectParam param);

    Integer getPayPersonNumByParam(@Param("prodId") Integer prodId, @Param("shopId") Long shopId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);


    void insertBatchOrderItemLang(@Param("orderItems") List<OrderItem> orderItems);

    List<ProdEffectRespParam> getProdEffectByDateAndProdIds(@Param("prodIds") List<Long> prodIds, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    /**
     * 根据订单编号获取订单项列表
     * @param orderNumber 订单编号
     * @return 订单项列表
     */
    List<OrderItem> listOrderItemByOrderNumber(@Param("orderNumber") String orderNumber);
}
